<template>
	<div class="aieditor-container">
		<el-card shadow="hover" class="h100">
            <center>
                <Editor :config="editor.config"></Editor>
            </center>
        </el-card>
    </div>
</template>
<script lang="ts">
import { ref, toRefs, reactive, onMounted } from 'vue';
import Editor from '/@/components/135editor/index.vue';
import { getSparkChatInfo } from '/@/api/ai/index';
export default {
	name: 'pages/editor',
	components: { Editor },
	setup() {
        const state = reactive({
            editor: {
				config: {
					aiModelUrlCreate: () => getSparkChatInfo(),
				}
			},
        });

        onMounted(() => {
            setTimeout(() => {
				window.current_editor.setContent('基于UEditor开发的 AI 富文本编辑器。<br>操作方法：在编辑器中输入内容并选中后，选择 AI 操作。');
			}, 500);
        })

        return {
			...toRefs(state),
		};
    }
};
</script>
